package net.dgg.rz.production.dao;

import net.dgg.rz.production.entity.ProductNodeFlow;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author:cuipeng
 * @ClassName <ProductNodeFlowDao>
 * @create 2018/12/14
 **/
@Component
public interface ProductNodeFlowDao {
    void save(ProductNodeFlow productNodeFlow);

    void update(ProductNodeFlow productNodeFlow);

    List<ProductNodeFlow> queryWithPage(Map map);

    Integer count(Map map);

    ProductNodeFlow queryFlowById(Map map);

    ProductNodeFlow selectFlowById(Map map);

    ProductNodeFlow selectOneById(Long id);

    List<Map> findFlowEntityByBusiness(ProductNodeFlow flowEntity);

    List<Map> findFlowEntityByBigFormatCode(ProductNodeFlow flowEntity);

    int countByBusinessCodeAndProductId(ProductNodeFlow flowEntity);

    int countByChannelAndGoods(ProductNodeFlow flowEntity);

    int countByBigBusinessCodeAndProductId(ProductNodeFlow flowEntity);

    ProductNodeFlow queryFlowByMap(Map map);

    ProductNodeFlow queryFlowByBigFormatCodeMap(Map map);

    Long selectFlowIdByProIdAndBusCode(@Param("businessCode") String businessCode, @Param("productId")Long productId );

    //根据小业态和产品获取当前流程信息和流程对应的节点版本号
    ProductNodeFlow queryFlowAndNodeVersionByBusinessAndProductId(Map map);
    //查询产品对应关系表
    List<Map> getProNewOld();
    void updateroNewOld(Long id);
}